#include <iostream>
#include <cstring>
using namespace std;

/*
已知有如下几种类型的网址
                www.baidu.com
                http://www.baidu.com
                https://www.baidu.com
要求：用户从键盘输入一个网址，如果网址符合上面的格式要求，打印登录成功，不符合，登录失败
                www.xxxxxxxxx.com
                http://www.xxxxxxxxx.com
                https://www.xxxxxxxxx.com  https://www..com  https://www.a.a.com
*/

int main()
{
    bool flag = false;
    string input;
    cout << "请输入网址：";
    cin >> input;

    int firstDot = input.find(".");
    string profix = input.substr(0, firstDot);

    if (input.size() < 4)
    {
        cout << "登录失败" << endl;
        return 0;
    }
    int secondDot = input.size() - 4;
    string data = input.substr(firstDot + 1, secondDot - firstDot - 1);
    string suffix = input.substr(secondDot + 1);
    cout << "数据分析:" << profix << " " << data << " " << suffix << endl;

    if ((profix == "www" || profix == "http://www" || profix == "https://www") && suffix == "com" && !data.empty())
    {
        flag = true;
    }

    if (flag)
    {
        cout << "登录成功" << endl;
    }
    else
    {
        cout << "登录失败" << endl;
    }
}